package cz.cuni.mff.ufal.volk.events;

import cz.cuni.mff.ufal.volk.NabaztagProxy;
import cz.cuni.mff.ufal.volk.Speech;

/**
 * A common Nabaztag event listener.
 *
 * @author Bartłomiej Etenkowski
 */
public interface NabaztagEventListener {

	/**
	 * The method is called after the bootcode has been successfully sent to the device.
	 * @param sender
	 */
	void onStarted(NabaztagProxy sender);

	/**
	 * The method is called after the user has pressed the button on Nabaztag's head. It is,
	 * however, not called during sound recording.
	 * @param sender
	 */
	void onClick(NabaztagProxy sender);

	/**
	 * The method is called after the user has pressed twice the button on Nabaztag's head.
	 * @param sender
	 */
	void onDoubleClick(NabaztagProxy sender);

	/**
	 * The method is called after sound has been recorded.
	 * @param sender
	 * @param s       the recorded speech (WAVE with ADPCM2 encoding)
	 */
	void onSoundRecorded(NabaztagProxy sender, Speech s);

	/**
	 * The method is called after the user has changed Nabaztag's ears' position.
	 * @param sender
	 * @param left
	 * @param right
	 */
	void onEarsMoved(NabaztagProxy sender, int left, int right);

	/**
	 * The method is called after the user has pressed the button on Nabaztag's head during
	 * broadcasting.
	 * @param sender
	 */
	void onVoiceInterrupted(NabaztagProxy sender);

	void onCompleted(NabaztagProxy sender);

	void onTimeout(NabaztagProxy sender);
}
